﻿using System.Data;
using System.Data.SqlClient;

namespace Codeflows.Recovery
{
    public static class ControlMessageSender
    {
        public static void SendRretry(SqlConnection sqlConnection)
        {
            if(sqlConnection.State != ConnectionState.Open)
                sqlConnection.Open();

            var command = sqlConnection.CreateCommand();
            command.CommandText = "QueueControlCommand";
            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.AddWithValue("command", 1);
            command.ExecuteNonQuery();
        }
    }
}
